home *** CD-ROM | disk | FTP | other *** search
/ SunSoft Catalyst CDWARE 1996 May to August / Catalyst CDWARE 1996 May to August.iso / .products / JavaWorld / javaworld / cgi-bin / jw-submit.cgi < prev    next >
Text File  |  1996-03-08  |  1KB  |  59 lines

  1. #!/bin/sh
  2. # jw-submit.cgi - script to handle miscellaneous survey forms for JavaWorld
  3.  
  4. mail=/usr/ucb/Mail
  5. address=jw-submit@javaworld.com
  6.  
  7. if [ $# -ge 1 ]; then
  8.     subject="$*"
  9. else
  10.     subject="jw-submit"
  11. fi
  12.  
  13. cat <<END_OF_MESSAGE
  14. Content-TYPE:   text/html
  15.  
  16. <HTML>
  17. <HEAD><TITLE>JavaWorld</TITLE></HEAD>
  18. <BODY>
  19. <A HREF="/javaworld/index.html">
  20. <IMG border=0 SRC="/javaworld/icons/b-thismonth.gif" ALT="[Table of contents]"></A>
  21. <P>
  22. <CENTER><H3>Thank you for participating in <EM>JavaWorld</EM>. We appreciate your patronage.</H3></CENTER>
  23. </BODY>
  24. </HTML>
  25. END_OF_MESSAGE
  26.  
  27. (
  28. echo "BEGIN RECORD `date`"
  29. echo "SUBMISSION: $*"
  30. echo "The environment variables are:"
  31. echo "CONTENT_LENGTH=$CONTENT_LENGTH"
  32. echo "CONTENT_TYPE=$CONTENT_TYPE"
  33. echo "DOCUMENT_ROOT=$DOCUMENT_ROOT"
  34. echo "GATEWAY_INTERFACE=$GATEWAY_INTERFACE"
  35. echo "HTTP_REFERER=$HTTP_REFERER"
  36. echo "HTTP_USER_AGENT=$HTTP_USER_AGENT"
  37. echo "QUERY_STRING=$QUERY_STRING"
  38. echo "REMOTE_ADDR=$REMOTE_ADDR"
  39. echo "REMOTE_HOST=$REMOTE_HOST"
  40. echo "REQUEST_METHOD=$REQUEST_METHOD"
  41. echo "SCRIPT_NAME=$SCRIPT_NAME"
  42. echo "SERVER_NAME=$SERVER_NAME"
  43. echo "SERVER_PORT=$SERVER_PORT"
  44. echo "SERVER_PROTOCOL=$SERVER_PROTOCOL"
  45. echo "SERVER_SOFTWARE=$SERVER_SOFTWARE"
  46. echo "ARGV=$*"
  47.  
  48. if [ -n "$CONTENT_LENGTH" ]; then
  49.     read var
  50. fi
  51. echo "STDINDATA=${var}"
  52.  
  53. echo "END RECORD `date`"
  54. echo
  55. ) 2>&1 | $mail -s "$subject" $address
  56.  
  57. exit 0
  58.  
  59.